class AssignemntsController < ApplicationController
  # GET /assignemnts
  # GET /assignemnts.xml
  def index
    @assignemnts = Assignemnt.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @assignemnts }
    end
  end

  # GET /assignemnts/1
  # GET /assignemnts/1.xml
  def show
    @assignemnt = Assignemnt.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @assignemnt }
    end
  end

  # GET /assignemnts/new
  # GET /assignemnts/new.xml
  def new
    @assignemnt = Assignemnt.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @assignemnt }
    end
  end

  # GET /assignemnts/1/edit
  def edit
    @assignemnt = Assignemnt.find(params[:id])
  end

  # POST /assignemnts
  # POST /assignemnts.xml
  def create
    @assignemnt = Assignemnt.new(params[:assignemnt])

    respond_to do |format|
      if @assignemnt.save
        flash[:notice] = 'Assignemnt was successfully created.'
        format.html { redirect_to(@assignemnt) }
        format.xml  { render :xml => @assignemnt, :status => :created, :location => @assignemnt }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @assignemnt.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /assignemnts/1
  # PUT /assignemnts/1.xml
  def update
    @assignemnt = Assignemnt.find(params[:id])

    respond_to do |format|
      if @assignemnt.update_attributes(params[:assignemnt])
        flash[:notice] = 'Assignemnt was successfully updated.'
        format.html { redirect_to(@assignemnt) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @assignemnt.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /assignemnts/1
  # DELETE /assignemnts/1.xml
  def destroy
    @assignemnt = Assignemnt.find(params[:id])
    @assignemnt.destroy

    respond_to do |format|
      format.html { redirect_to(assignemnts_url) }
      format.xml  { head :ok }
    end
  end
end
